class SkillIterator:
    def __init__(self, skills):
        self.skills = skills
        self.index = 0

    def __next__(self):
        if self.index >= len(self.skills):
            raise StopIteration()
        else:
            item = self.skills[self.index]
            self.index += 1
            return item


class Skill:
    def __init__(self, name):
        self.name = name


class SkillManager:
    def __init__(self, skills):
        self.skills = skills

    def __iter__(self):
        return SkillIterator(self.skills)


skill_manager = SkillManager([Skill('寒冰'), Skill('闪电')])

for item in skill_manager:
    print(item)
